

package com.yungu.swift.order.utils;

/**
 * @author Zerrion
 * @version 1.0
 * @description 获取银行编号
 * @date 2018/12/29 18:17
 */
public class GetBankNo {

    private final static String[] bankName = {
            "工商银行", "农业银行", "中国银行", "建设银行", "招商银行", "邮储银行", "交通银行", "浦发银行", "民生银行",
            "兴业银行", "平安银行", "中信银行", "华夏银行", "广发银行", "光大银行", "北京银行", "宁波银行"
    };
    private final static int[] bankNo = {
            1002, 1005, 1026, 1003, 1001, 1066, 1020, 1004, 1006, 1009, 1010, 1021, 1025,
            1027, 1022, 1032, 1056
    };

    public static int getBankNo(String name) {
        int low = 0;
        int high = bankName.length;
        while (low < high) {

            if (bankName[low].equals(name)) {
                return bankNo[low];
            }
            low++;
        }
        return -1;
    }
}
